<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>大区管理</title>
		<link rel="stylesheet" href="css/reset.css" />
        <link rel="stylesheet" href="css/platform.css" />
        <link rel="stylesheet" href="css/table.css" />
        <!--<link rel="stylesheet" />-->
        <style>
            .small.add {
                margin-bottom: 10px;
            }
            .small.search {
                margin-left: 20px;
            }
            .u-error {
                display: none;
            }
            .sendtimes {
                font-size: 14px;
            }
        </style>
	</head>

	<body>
		<div class="header">
            <div class="u-title">大区管理</div>
        </div>
        <div class="main" ms-controller="mainController">
            <div class="u-multiform">
                <div class="column">
                    <label>原大区编码：</label>
                    <div class="cnt-box">
                        <input class="u-ipt" placeholder="请输入原大区编码" maxlength="10" ms-duplex="orgZoneCode" />
                    </div>
                </div>
                 <div class="column">
                    <label>并入大区编码：</label>
                    <div class="cnt-box">
                        <input class="u-ipt" placeholder="请输入并入大区编码" maxlength="10" ms-duplex="currZoneCode" />
                    </div>
                    <button class="u-btn small search" ms-click="searchBlackList">合并</button>
                </div>
            </div>
        </div>
        
        <!--弹框区域-->
        <div ms-controller="popController">
            <div class="u-popup" id="popup_tips">
                <div class="bg"></div>
                <div class="asTable">
                    <div class="asTableCell">
                        <div class="asCell alert">
                            <a href="javascript:;" class="close btn-close">×</a>
                            <p class="title">提示</p>
                            <div class="container">
                                <div class="success"></div>
                                <p>
                                	{{resultMsg}}
                                </p>
                            </div>
                            <div class="btn-box">
                                <button class="u-btn btn-close">确定</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="loadData"></div>
        <script src="js/jquery.min.js"></script>
        <script src="js/avalon.shim.sn.js"></script>
        <script src="js/swift-ui-table-1.1.js"></script>
        <script src="js/platform.js"></script>
        <script src="js/DataInterface/DataInterface.js"></script>
        <script>
        	$(function() {
    //主流程对象
    var mainCtrl = avalon.define({
        $id: "mainController",
        currZoneCode:"",
        orgZoneCode:"",
        searchBlackList: function() {
            if($(".column .u-ipt").val() == "") {
                alert("大区编码不能为空");
                return;
            }
              $.ajax({
                type: "post",
                dataType: "json",
                data: {
                    "currZoneCode": mainCtrl.currZoneCode,
                    "orgZoneCode": mainCtrl.orgZoneCode
                },
                url:  "${interface_url}/adminPage/zoneChange/updateZoneCode.do",
                success: function(response) {
                    if(response.retFlag == 1) {
                        popCtrl.resultMsg = "更新成功";
                    } else {
                    	popCtrl.resultMsg = response.errorMessage;
                    }
           			 $("#popup_tips").show();
                },
                error: function(err) {
                    console.log(err);
                }
            });
            
        }
    });

    //弹框对象
    var popCtrl = avalon.define({
        $id: "popController",
		resultMsg: ""
    });
    avalon.scan();
});
        	
        </script>
	</body>
</html>
